package com.sunday.pinxinghui;

import android.os.RecoverySystem;
import android.provider.Settings;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.sunday.common.model.ResultDO;
import com.sunday.pinxinghui.entity.Order;

import java.util.List;

/**
 * Created by 刘涛 on 2017/11/14.
 */

public class Test {

    public static void main(String args[]){
        String str = "{\"ok\":true,\"code\":0,\"message\":\"success\",\"result\":[{\"orderNo\":\"PX2017111406317\",\"orderId\":129,\"type\":2,\"memberId\":26,\"status\":0,\"sellerId\":null,\"sellerName\":null,\"num\":1,\"totalFee\":0.01,\"name\":\"测试\",\"mobile\":\"18672290606\",\"address\":{\"id\":null,\"provinceId\":null,\"cityId\":null,\"districtId\":null,\"streetId\":null,\"provinceName\":null,\"cityName\":null,\"districtName\":null,\"streetName\":null,\"name\":\"测试\",\"mobile\":\"18672290606\",\"address\":\"浙江省杭州市萧山区宁围镇国泰科技大厦\",\"type\":0},\"payMethod\":null,\"amountFee\":0.01,\"amount\":0.00,\"score\":0.00,\"coupon\":0,\"coffers\":0.00,\"totalCommission\":null,\"expressFee\":0.00,\"memo\":\"\",\"express\":null,\"expressNo\":null,\"expressCode\":null,\"sendTime\":\"\",\"sendMethod\":2,\"receiveTime\":\"\",\"createTime\":\"2017-11-14 15:59:26\",\"finishedTime\":\"\",\"payTime\":\"\",\"refundTime\":\"\",\"refundFinishTime\":\"\",\"plusTime\":0,\"refundType\":null,\"oldPayStatus\":null,\"oldShipStatus\":null,\"oldReceiveStatus\":null,\"service\":null,\"items\":[{\"orderItemId\":110,\"productId\":21,\"productName\":\"美国红蛇果苹果新鲜进口\",\"productImage\":\"http://ol-quan2017.oss-cn-shanghai.aliyuncs.com/imgs/408dbac21f81d1ea3d27bd791be239f155bcfdb6\",\"normal\":\"重量:200g\",\"price\":0.01,\"num\":1,\"type\":1,\"status\":0,\"commission\":null,\"express\":null,\"expressNo\":null,\"sendTime\":\"\"}]},{\"orderNo\":\"PX2017111440025\",\"orderId\":128,\"type\":2,\"memberId\":26,\"status\":0,\"sellerId\":null,\"sellerName\":null,\"num\":1,\"totalFee\":0.01,\"name\":\"测试\",\"mobile\":\"18672290606\",\"address\":{\"id\":null,\"provinceId\":null,\"cityId\":null,\"districtId\":null,\"streetId\":null,\"provinceName\":null,\"cityName\":null,\"districtName\":null,\"streetName\":null,\"name\":\"测试\",\"mobile\":\"18672290606\",\"address\":\"浙江省杭州市萧山区宁围镇国泰科技大厦\",\"type\":0},\"payMethod\":null,\"amountFee\":0.01,\"amount\":0.00,\"score\":0.00,\"coupon\":0,\"coffers\":0.00,\"totalCommission\":null,\"expressFee\":0.00,\"memo\":\"\",\"express\":null,\"expressNo\":null,\"expressCode\":null,\"sendTime\":\"\",\"sendMethod\":2,\"receiveTime\":\"\",\"createTime\":\"2017-11-14 15:10:17\",\"finishedTime\":\"\",\"payTime\":\"\",\"refundTime\":\"\",\"refundFinishTime\":\"\",\"plusTime\":0,\"refundType\":null,\"oldPayStatus\":null,\"oldShipStatus\":null,\"oldReceiveStatus\":null,\"service\":null,\"items\":[{\"orderItemId\":109,\"productId\":21,\"productName\":\"美国红蛇果苹果新鲜进口\",\"productImage\":\"http://ol-quan2017.oss-cn-shanghai.aliyuncs.com/imgs/408dbac21f81d1ea3d27bd791be239f155bcfdb6\",\"normal\":\"重量:200g\",\"price\":0.01,\"num\":1,\"type\":1,\"status\":0,\"commission\":null,\"express\":null,\"expressNo\":null,\"sendTime\":\"\"}]},{\"orderNo\":\"PX2017111231502\",\"orderId\":127,\"type\":1,\"memberId\":26,\"status\":0,\"sellerId\":null,\"sellerName\":null,\"num\":1,\"totalFee\":500.00,\"name\":\"hhn\",\"mobile\":\"15888887777\",\"address\":{\"id\":null,\"provinceId\":null,\"cityId\":null,\"districtId\":null,\"streetId\":null,\"provinceName\":null,\"cityName\":null,\"districtName\":null,\"streetName\":null,\"name\":\"hhn\",\"mobile\":\"15888887777\",\"address\":\"北京市北京市东城区交道口街道nnmm\",\"type\":0},\"payMethod\":null,\"amountFee\":500.00,\"amount\":0.00,\"score\":0.00,\"coupon\":0,\"coffers\":0.00,\"totalCommission\":null,\"expressFee\":0.00,\"memo\":\"\",\"express\":null,\"expressNo\":null,\"expressCode\":null,\"sendTime\":\"\",\"sendMethod\":3,\"receiveTime\":\"\",\"createTime\":\"2017-11-12 23:52:13\",\"finishedTime\":\"\",\"payTime\":\"\",\"refundTime\":\"\",\"refundFinishTime\":\"\",\"plusTime\":0,\"refundType\":null,\"oldPayStatus\":null,\"oldShipStatus\":null,\"oldReceiveStatus\":null,\"service\":null,\"items\":[{\"orderItemId\":108,\"productId\":10,\"productName\":\"BOB彩妆套装组合全套 初学者 裸妆淡妆化妆品工具套装 美妆套装组合\",\"productImage\":\"http://ol-quan2017.oss-cn-shanghai.aliyuncs.com/imgs/9d48d5b853f9c4f8b93c3bee6ea1836ab726e1f7\",\"normal\":\"重量:200g\",\"price\":500.00,\"num\":1,\"type\":1,\"status\":0,\"commission\":null,\"express\":null,\"expressNo\":null,\"sendTime\":\"\"}]}";

        Gson gson = new Gson();
        ResultDO resultDO = gson.fromJson(str,
                new TypeToken<ResultDO<List<Order>>>() {
                }.getType());
        resultDO.toString();
    }
}
